<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<f:view>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>Reservar una mesa</title>
</head>
<style type="text/css">
    	body {font-family: Verdana; font-size: 10pt;}
    </style>
<body>
<h:graphicImage value="/images/Pizza-75.png"/> 
<h:graphicImage value="/images/webpizza.png"/> 
<h:graphicImage value="/images/Pizza-75.png"/> 
<h1>WebPizza - Reserva de mesas</h1>
<hr />
<h2> Mesas disponibles: </h2>
<h:dataTable value="#{Reserve.mesasDisponibles}" var="mesas" style="border: 1px solid black;">
	<h:column>
		<f:facet name="header">
			<h:outputText value="Numero"/>
		</f:facet>
		<h:outputText value="#{mesas.id}"/>
	</h:column>
	<h:column>
		<f:facet name="header">
			<h:outputText value="Sillas"/>
		</f:facet>
		<h:outputText value="#{mesas.chairs}"/>
	</h:column>
	<h:column>
		<f:facet name="header">
			<h:outputText value="Ubicacion"/>
		</f:facet>
		<h:outputText value="#{mesas.location}"/>
	</h:column>
</h:dataTable>

<br />

<h2> Realizar una reserva </h2>
<h:form>
	<h:panelGrid width="35%" columns="2">
		<h:panelGroup>
			Fecha reserva :
		</h:panelGroup>
		<h:inputText id="fecha" value="#{Reserve.fecha}" required="true">
			<f:convertDateTime dateStyle="default" timeStyle="default" type="both"/>
		</h:inputText>	
		<h:panelGroup>
			Numero de mesa:
		</h:panelGroup>
			<h:inputText id="mesaId" value="#{Reserve.mesaId}" required="true">
			<f:convertNumber type="number"/>
		</h:inputText>	
		<h:panelGroup>
			<h:commandButton value="Aceptar" action="#{Reserve.reserve}"/>	
		</h:panelGroup>
		<h:panelGroup>
			<h:outputText value="#{Reserve.errors}"/>
		</h:panelGroup>
		
	</h:panelGrid>	
</h:form>
</body>
</html>
</f:view>
